<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,shrink-to-fit=no">
    <title>支付宝授权</title>
    <style>
        .background{
            background-color: #1d2124;
            background-size:cover;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
        }
        .center{
            width: 100%;
            text-align: center;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }
    </style>

</head>
<body>
<div class="full">
    <div class="background">
        <div class="center">
            <div style="color: white"><h3>授权码</h3></div>
            <div style="color: white" id="code"></div>
        </div>
    </div>
</div>

<script>
function GetQueryString(name)
{
    let reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    let r = window.location.search.substr(1).match(reg); //search,查询？后面的参数，并匹配正则
    if(r!==null) {
        return unescape(r[2]);
    }else {
        return null;
    }
}

window.onload = function () {
    document.getElementById("code").innerText = GetQueryString("app_auth_code");

}
</script>

</body>
</html>